<?php
ini_set('display_errors',1);

$url = 'ftp://cms:Vtpicms_1234@221.8.110.11/syncdir/remote/SMG/response/SMG_SOAP_RESULT_SMG_SOAP_MSG_201310101556398137719.xml';
$url_arr = parse_url($url);

include dirname(dirname(dirname(dirname(__FILE__)))).'/np/np_ftp.php';
$port = !empty($url_arr["port"])?$url_arr["port"]:21;
$ftp1=new nns_ftp($url_arr['host'],$url_arr["user"],$url_arr["pass"],$port);
$ftpcon1=$ftp1->connect(10,false);

if ($ftp1->connect_no==false) {
	echo 'connect fail';
    return FALSE;
}

 $notify_save_path = dirname(dirname(dirname(__FILE__))).'/data/mgtv/jllt/notify'.$url_arr["path"];
$path_parts = pathinfo($notify_save_path);
 if (!is_dir($path_parts['dirname'])){
     mkdir($path_parts['dirname'], 0777, true);
 }  
 echo  $notify_save_path;
 echo '<br/>';
 echo    $url_arr["path"];
$ftp1->get('syncdir/remote/SMG/response/SMG_SOAP_RESULT_SMG_SOAP_MSG_201310101556398137719.xml',$notify_save_path);	

echo '<a href="http://58.20.34.203/nn_mgtvbk/data/mgtv/jllt/notify'.$url_arr["path"].'" target="_blank">'.$url.'</a>';